package com.example.tests;

import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;

import java.util.Set;

import org.testng.annotations.Test;

public class GroupRemovalTests extends TestBase {

	@Test
	public void testFirstGroupCanBeRemoved() throws Exception {
		Set<GroupObject> oldList = app.getGroupHelper().getGroups();
		int numberOfGroupForDelete = 2;
		app.getGroupHelper().deleteGroup(numberOfGroupForDelete);
		// validate
		Set<GroupObject> newList = app.getGroupHelper().getGroups();
		verifyGroupRemoved(oldList, newList);
	}

	private void verifyGroupRemoved(Set<GroupObject> oldList,
			Set<GroupObject> newList) {
		assertThat(newList.size(), equalTo(oldList.size() - 1));
		// assertThat(newList, NOTequalTo(oldList));
	}
}
